using System;
using System.Collections.Generic;
using System.Text;
using MindFactorial.LaunchPoint.Common;
using MindFactorial.LaunchPoint.Runtime;
using System.Configuration;

namespace MindFactorial.LaunchPoint.Runtime
{
    /// <summary>
    /// Represents connection to the Business Rule Engine in the LaunchPoint Server
    /// </summary>
    public class BREContext : ContextObject 
    {

        LaunchPointApplication _runnable;
        BRERuleCollection _rules;
        internal BREContext(LaunchPointApplication runnable)
        {
            this._runnable = runnable;
            this._rules = new BRERuleCollection(runnable);
            
            
        }

        /// <summary>
        /// Creates a rule given the adapter and rule naLaunchPoint to identify the actual service
        /// you want to connect to.
        /// </summary>
        /// <param name="adapter_id"></param>
        /// <param name="rule_name"></param>
        /// <returns></returns>
        public BRERule CreateRuleService(string adapter_id, string rule_name)
        {
            BRERule rule = new BRERule(adapter_id, rule_name, _runnable);
            return rule;                
        }

        /// <summary>
        /// Gets the collection of rules. 
        /// 
        /// </summary>
        public BRERuleCollection Rule
        {
            get
            {
                return _rules;
            }
        }
       
    }    

    
}